<#include "/common/headAdmin.ftl">
<@head>
    <div class="container">
<!--
${pages!}
-->
    </div> <!-- /container -->
   <div class="container">



<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">用户管理</div>
  <div class="panel-body">
    <p>用户管理</p>
  </div>

  <!-- Table -->
  <table class="table">
<tr>
<th>ID</th>
<th>账号</th>
<th>金额</th>
<th>QQ</th>
<th>手机</th>
<th>创建时间</th>
<th>状态</th>
<th>上级</th>
<th>银行地址</th>
<th>银行名称</th>
<th>卡号</th>
<th>收款姓名</th>
<th>更新</th>
<th></th>
</tr>
 <#list pages.list as data>
 <tr>
 <td>${data.id}</td>

 <td>${data.userName}</td>
 <td>${money(data.id)}</td>
 <td>${data.qq!}</td>
  <td>${data.phone!}</td>
 <td>${data.createTime?datetime}</td>
 <td><#if data.status==1>正常<#else>禁用</#if></td>
 <td>${data.pid}</td>
 <td>${data.bankAddr!}</td>
 <td>${data.bankName!}</td>
 <td>${data.bankCard!}</td>
 <td>${data.bankUser!}</td>
 <td>${data.updateTime?datetime}</td>

 <td>

 <#if data.status == 1>
   <button type="button" class="btn btn-default status2 btn-danger"  data="${data.id}">禁用</button>
  <#else>
   <button type="button" class="btn btn-default status1 "   data="${data.id}">启用</button>
   </#if>
  </td>
 </tr>
 </#list>










  </table>
</div>


<@page "searchUserInfo" pages/>



</div> <!-- /container -->



<@js>
//-------

$(".status2").click(function(){
    var id=$(this).attr("data");
    $.post("updateStatus", { "id":id,status:"2" },
              function(data){
                 console.log(data); //  2pm
                alert(data.status+data.message);
                 if(data.status==200){
                    window.location.href=window.location.href;
                 }
             }, "json");

});

$(".status1").click(function(){
    var id=$(this).attr("data");
    $.post("updateStatus", { "id":id,status:"1" },
              function(data){
                 console.log(data); //  2pm
                alert(data.status+data.message);
                 if(data.status==200){
                    window.location.href=window.location.href;
                 }
             }, "json");

});


</@js>

</@head>






